FROM python:3.11-slim
WORKDIR /app

RUN apt-get update && apt-get install -y \
    libreoffice \
    ffmpeg \ 
    && rm -rf /var/lib/apt/lists/*

COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY ../libs/markitdown /opt/markitdown
RUN pip install --no-cache-dir -e /opt/markitdown[all]

# 复制整个项目，包括前端模板和静态文件
COPY . .

CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]